GBML manual / Backgrounds

room_layer_look

Moves one of the room’s tile layers sideways by a different amount on every row of the screen, so only that layer ripples like water while the others stay still. layer is ROOM_LAYER_MAIN, ROOM_LAYER_FRONT or ROOM_LAYER_BACK, look is one of the BGLOOK_ constants, strength (1 to 3) is how strong it is, and speed is how fast it moves. BGLOOK_NONE turns it off. It is the room-layer twin of background_look.

Game Boy: not available

Game Boy Color: not available

Sega Genesis: not built yet

On other consoles this differs: see Side by side and How the consoles differ.

Syntax

room_layer_look(layer, look, strength, speed)

Arguments

NameType
layerroom_layer
lookbglook
strengthint
speedreal

Returns

Nothing.

Description

Moves one of the room's tile layers sideways by a different amount on every row of the screen, so that layer ripples like water while the others stay still. layer is ROOM_LAYER_MAIN (the room's own tiles), ROOM_LAYER_FRONT or ROOM_LAYER_BACK. The other three numbers are the ones background_look takes: look is a BGLOOK_ name, strength is a whole number from 1 to 3, and speed is how fast it moves. BGLOOK_NONE turns it off. A room that does not have that layer does nothing.

You can also pick this in the Room Editor, with no code: in Tile layers, the Effect of a layer (Wobble: Wave or Sway) starts the same look when the room loads, and the canvas plays it live.

The look ends when the next room loads. Each layer has a look of its own, so the Back layer can ripple while the Main layer stays still.

What it costs

Each layer that wobbles uses one of the 8 row-by-row effects the console has, and no matrix. A room change keeps two of the eight for itself, so there are six left for you, shared with everything else that works row by row. A game that never wobbles a layer does not carry any of this.

Example

room_layer_look(ROOM_LAYER_BACK, BGLOOK_WAVE, 3, 1);

Makes the Back layer ripple, a wave that travels down the screen, and leaves the Main and Front layers straight.

On the GBA

Costs ONE of the console’s 8 row-by-row (H-Blank) effects for as long as the look is on, for each layer that wobbles, and no matrix. A room change keeps two of the eight for itself, so six are left for you, shared with everything else that works row by row. A room with no such layer does nothing for it. The look ends when the next room loads. In the Room Editor, the Effect of a tile layer (Tile layers) writes this call for you. A game that never wobbles a layer carries none of this.

See also: background_lookBGLOOK_WAVEBGLOOK_NONEroom_layer_scroll_speedroom_layer_visiblescreen_blendscreen_mosaicBackgrounds